#include<iostream>
#include<unistd.h>
#include<stdlib.h>
#include<string.h>
using namespace std;

int main()
{
  pid_t id = fork();
  while(1)
  {
    while(id == 0)
    {
      //子进程
      cout << "i am child my pid: " << getpid() << "my ppid " << getppid() << endl;
      sleep(1);
    }
    
      //父进程
    sleep(5);
    exit(1);
  }
  return 0;
}
